var mongoose = require("mongoose");
var Schema = mongoose.Schema;

var schemaComment = new Schema({
    title: String,
    content: String,
    user: { type: Schema.Types.ObjectId, ref: "user" },
    comments: [{ commentUser: { type: Schema.Types.ObjectId, ref: "user" }, commentContent: String }],
    createTime: { type: Date, default: Date.now() },
    updateTime: { type: Date, default: Date.now() }
})

module.exports = mongoose.model("comment", schemaComment, "comments");